{extend name="layout/common_layout" /}
{block name="body"}
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">尺寸管理</li>
            <!--<li class=""><a href="{:url('admin/type/add')}">添加尺寸</a></li>-->
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>分类名称</th>
                        <th>分类尺寸</th>
                        <th>创建时间</th>
                        <th>修改时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.f_name}</td>
                        <td>
                            {if condition="$vo.type eq 1"}
                            大度
                            {else/}
                            正度
                            {/if}
                            {if condition="$vo.fid eq 3"}
                                {$vo.num}
                            {else/}
                                {$vo.num}开{$vo.long}*{$vo.wide}
                            {/if}

                        </td>
                        <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                        <td>{$vo.update_time|date="Y-m-d H:i:s",###}</td>
                        <td>
                            <a href="{:url('admin/type/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <!--<a href="{:url('admin/type/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>-->
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {notempty name = 'list'}
                {$list->render()}
                {/notempty}
            </div>
        </div>
    </div>
{/block}

{block name="js"}
<script type="text/javascript" src="__JS__/dialog/layer.js"></script>
{/block}

{block name="script"}
<script>

    //弹框：
    function goodsIndex(th){
        var open_url = $(th).attr('data-url');
        if(open_url){
            layer.open({
                type: 2,
                title:'规格列表',
                btn: ['确定','关闭'],
                shade: [0.8, '#808080'],
                closeBtn:1,
                area: ['700px','500px'],
                maxmin: false,
                content: open_url,
                zIndex: 1001,
                success: function(layero){
                },
                yes:function(index, layero){
                    var id = $(th).attr('index');
                }
            });
        }
    }

    function goodsIndexUnit(th){


        var open_url = $(th).attr('data-url');
        if(open_url){
            layer.open({
                type: 2,
                title:'单位列表',
                btn: ['确定','关闭'],
                shade: [0.8, '#808080'],
                closeBtn:1,
                area: ['700px','500px'],
                maxmin: false,
                content: open_url,
                zIndex: 1001,
                success: function(layero){
                },
                yes:function(index, layero){
                    var id = $(th).attr('index');
                }
            });
        }
    }

</script>
{/block}